/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VentanaPrincipal.java
 *
 * Created on 06-abr-2012, 22:20:45
 */
package gui;

import com.sun.jmx.remote.internal.IIOPHelper;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.ListIterator;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.scene.layout.Background;

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import modelo.Alimento;
import modelo.Bebida;
import modelo.Cliente;
import modelo.Comida;
import modelo.Restaurante;

/**
 *
 * @author Lenovo
 */
public class VentanaPrincipal extends javax.swing.JFrame implements ActionListener {

    /**
     * Creates new form VentanaPrincipal
     */
    private JButton mesas[][];
    private JButton etiquetas[][];
    private Restaurante miRestaurante;
    private JButton cambiarColor;
    private int sillaPedido;
    private int mesaPedido;
    JFileChooser jFC;

    public VentanaPrincipal() {
        mesas = new JButton[4][15];
        etiquetas = new JButton[1][15];
        initComponents();
        cargarEtiquetas();
        cargarMesas();
        bloquearComponentesPedido();
        cambiarColor = new JButton();
        miRestaurante = new Restaurante();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPOcupacion = new javax.swing.JPanel();
        jTPGeneral = new javax.swing.JTabbedPane();
        jPIngresoPedido = new javax.swing.JPanel();
        jPBebida = new javax.swing.JPanel();
        jLImgBebida = new javax.swing.JLabel();
        jCBBebida = new javax.swing.JComboBox();
        jLBebida = new javax.swing.JLabel();
        jLCantBebida = new javax.swing.JLabel();
        jSCantBebida = new javax.swing.JSpinner();
        jPPlatoFuerte = new javax.swing.JPanel();
        jLImgPlatoFuerte = new javax.swing.JLabel();
        jCBPlatoFuerte = new javax.swing.JComboBox();
        jLPlatoFuerte = new javax.swing.JLabel();
        jLCantPlatoFuerte = new javax.swing.JLabel();
        jSCantPlatoFuerte = new javax.swing.JSpinner();
        jPEntrada = new javax.swing.JPanel();
        jLImgEntrada = new javax.swing.JLabel();
        jCBEntrada = new javax.swing.JComboBox();
        jLEntrada = new javax.swing.JLabel();
        jLCantidad = new javax.swing.JLabel();
        jSCantEntrada = new javax.swing.JSpinner();
        jPPostre = new javax.swing.JPanel();
        jLImgPostre = new javax.swing.JLabel();
        jCBPostre = new javax.swing.JComboBox();
        jLPostre = new javax.swing.JLabel();
        jLCantPostre = new javax.swing.JLabel();
        jSCantPostre = new javax.swing.JSpinner();
        jBRegistrarPedido = new javax.swing.JButton();
        jBCancelarRegPedido = new javax.swing.JButton();
        jPCuentas = new javax.swing.JPanel();
        jLCuentas = new javax.swing.JLabel();
        jPCuentaIndividual = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTACtaIndividual = new javax.swing.JTextArea();
        jBPagarCtaIndividual = new javax.swing.JButton();
        jPCuentaPorMesa = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTACtaMesa = new javax.swing.JTextArea();
        jBCtaConsolidada = new javax.swing.JButton();
        jBCtaDetallada = new javax.swing.JButton();
        jBPagarCtaMesa = new javax.swing.JButton();
        jPModificaciones = new javax.swing.JPanel();
        jPPedidoActual = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTAComidas = new javax.swing.JTextArea();
        jLEntrada4 = new javax.swing.JLabel();
        jLEntrada5 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTABebidas = new javax.swing.JTextArea();
        jPOpciones = new javax.swing.JPanel();
        jRBAgregarEntrada = new javax.swing.JRadioButton();
        jRBAgregarPlatoFuerte = new javax.swing.JRadioButton();
        jRBAgregarPostre = new javax.swing.JRadioButton();
        jRBAgregarBebida = new javax.swing.JRadioButton();
        jPBotones = new javax.swing.JPanel();
        jBContinuar = new javax.swing.JButton();
        jBCancelar = new javax.swing.JButton();
        jMBPrincipal = new javax.swing.JMenuBar();
        jMOpciones = new javax.swing.JMenu();
        jMIRegNuevoProd = new javax.swing.JMenuItem();
        jMIRetirarProd = new javax.swing.JMenuItem();
        jMIBuscarProd = new javax.swing.JMenuItem();
        jMIModificarPrecioProd = new javax.swing.JMenuItem();
        jMListados = new javax.swing.JMenu();
        jMIListadoEntradas = new javax.swing.JMenuItem();
        jMIListadoPlatosFuertes = new javax.swing.JMenuItem();
        jMIListadoPostres = new javax.swing.JMenuItem();
        jMIListadoBebidas = new javax.swing.JMenuItem();
        jMAcercaDe = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Restaurante \"Con Sabor\"");
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setMaximizedBounds(new java.awt.Rectangle(0, 0, 1600, 800));
        setResizable(false);

        jPOcupacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED), "Detalle de ocupación", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(102, 0, 102))); // NOI18N
        jPOcupacion.setForeground(new java.awt.Color(102, 0, 102));

        javax.swing.GroupLayout jPOcupacionLayout = new javax.swing.GroupLayout(jPOcupacion);
        jPOcupacion.setLayout(jPOcupacionLayout);
        jPOcupacionLayout.setHorizontalGroup(
            jPOcupacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 331, Short.MAX_VALUE)
        );
        jPOcupacionLayout.setVerticalGroup(
            jPOcupacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 563, Short.MAX_VALUE)
        );

        jTPGeneral.setForeground(new java.awt.Color(102, 0, 102));
        jTPGeneral.setEnabled(false);
        jTPGeneral.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N

        jPBebida.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Bebida", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jLImgBebida.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/bebidas.jpg"))); // NOI18N
        jLImgBebida.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jCBBebida.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jCBBebida.setForeground(new java.awt.Color(153, 0, 51));
        jCBBebida.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione una opción" }));

        jLBebida.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLBebida.setForeground(new java.awt.Color(153, 0, 51));
        jLBebida.setText("Bebida a ordenar:");

        jLCantBebida.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLCantBebida.setForeground(new java.awt.Color(153, 0, 51));
        jLCantBebida.setText("Cantidad para este pedido:");

        javax.swing.GroupLayout jPBebidaLayout = new javax.swing.GroupLayout(jPBebida);
        jPBebida.setLayout(jPBebidaLayout);
        jPBebidaLayout.setHorizontalGroup(
            jPBebidaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPBebidaLayout.createSequentialGroup()
                .addGroup(jPBebidaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPBebidaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPBebidaLayout.createSequentialGroup()
                            .addComponent(jLCantBebida)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSCantBebida, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPBebidaLayout.createSequentialGroup()
                            .addComponent(jLBebida)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jCBBebida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPBebidaLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(jLImgBebida)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPBebidaLayout.setVerticalGroup(
            jPBebidaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPBebidaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLImgBebida)
                .addGap(24, 24, 24)
                .addGroup(jPBebidaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLBebida)
                    .addComponent(jCBBebida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addGroup(jPBebidaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLCantBebida)
                    .addComponent(jSCantBebida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPPlatoFuerte.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Plato Fuerte", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jLImgPlatoFuerte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/platosFuertes.jpg"))); // NOI18N
        jLImgPlatoFuerte.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jCBPlatoFuerte.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jCBPlatoFuerte.setForeground(new java.awt.Color(153, 0, 51));
        jCBPlatoFuerte.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione una opción" }));

        jLPlatoFuerte.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLPlatoFuerte.setForeground(new java.awt.Color(153, 0, 51));
        jLPlatoFuerte.setText("Plato Fuerte a ordenar:");

        jLCantPlatoFuerte.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLCantPlatoFuerte.setForeground(new java.awt.Color(153, 0, 51));
        jLCantPlatoFuerte.setText("Cantidad para este pedido:");

        javax.swing.GroupLayout jPPlatoFuerteLayout = new javax.swing.GroupLayout(jPPlatoFuerte);
        jPPlatoFuerte.setLayout(jPPlatoFuerteLayout);
        jPPlatoFuerteLayout.setHorizontalGroup(
            jPPlatoFuerteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPlatoFuerteLayout.createSequentialGroup()
                .addGroup(jPPlatoFuerteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPPlatoFuerteLayout.createSequentialGroup()
                        .addGap(56, 56, 56)
                        .addComponent(jLPlatoFuerte)
                        .addGap(44, 44, 44)
                        .addComponent(jCBPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(43, 43, 43)
                        .addComponent(jLCantPlatoFuerte)
                        .addGap(39, 39, 39)
                        .addComponent(jSCantPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPPlatoFuerteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLImgPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, 857, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(28, Short.MAX_VALUE))
        );
        jPPlatoFuerteLayout.setVerticalGroup(
            jPPlatoFuerteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPPlatoFuerteLayout.createSequentialGroup()
                .addComponent(jLImgPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPPlatoFuerteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLPlatoFuerte)
                    .addComponent(jCBPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLCantPlatoFuerte)
                    .addComponent(jSCantPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(41, 41, 41))
        );

        jPEntrada.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Entrada", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jLImgEntrada.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/entradas.gif"))); // NOI18N
        jLImgEntrada.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jCBEntrada.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jCBEntrada.setForeground(new java.awt.Color(153, 0, 51));
        jCBEntrada.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione una opción" }));

        jLEntrada.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLEntrada.setForeground(new java.awt.Color(153, 0, 51));
        jLEntrada.setText("Entrada a ordenar:");

        jLCantidad.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLCantidad.setForeground(new java.awt.Color(153, 0, 51));
        jLCantidad.setText("Cantidad para este pedido:");

        javax.swing.GroupLayout jPEntradaLayout = new javax.swing.GroupLayout(jPEntrada);
        jPEntrada.setLayout(jPEntradaLayout);
        jPEntradaLayout.setHorizontalGroup(
            jPEntradaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPEntradaLayout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addComponent(jLImgEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPEntradaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLCantidad)
                    .addComponent(jLEntrada))
                .addGap(18, 18, 18)
                .addGroup(jPEntradaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jCBEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSCantEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(121, Short.MAX_VALUE))
        );
        jPEntradaLayout.setVerticalGroup(
            jPEntradaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPEntradaLayout.createSequentialGroup()
                .addContainerGap(19, Short.MAX_VALUE)
                .addGroup(jPEntradaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLEntrada)
                    .addComponent(jCBEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPEntradaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLCantidad)
                    .addComponent(jSCantEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16))
            .addComponent(jLImgEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPPostre.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Postre", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jLImgPostre.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/postre.jpg"))); // NOI18N
        jLImgPostre.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jCBPostre.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jCBPostre.setForeground(new java.awt.Color(153, 0, 51));
        jCBPostre.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione una opción" }));

        jLPostre.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLPostre.setForeground(new java.awt.Color(153, 0, 51));
        jLPostre.setText("Postre a ordenar:");

        jLCantPostre.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLCantPostre.setForeground(new java.awt.Color(153, 0, 51));
        jLCantPostre.setText("Cantidad para este pedido:");

        javax.swing.GroupLayout jPPostreLayout = new javax.swing.GroupLayout(jPPostre);
        jPPostre.setLayout(jPPostreLayout);
        jPPostreLayout.setHorizontalGroup(
            jPPostreLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPostreLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLImgPostre)
                .addGap(18, 18, 18)
                .addGroup(jPPostreLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPPostreLayout.createSequentialGroup()
                        .addComponent(jLPostre)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jCBPostre, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPPostreLayout.createSequentialGroup()
                        .addComponent(jLCantPostre)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jSCantPostre, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPPostreLayout.setVerticalGroup(
            jPPostreLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPostreLayout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addGroup(jPPostreLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLPostre)
                    .addComponent(jCBPostre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(30, 30, 30)
                .addGroup(jPPostreLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLCantPostre)
                    .addComponent(jSCantPostre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGroup(jPPostreLayout.createSequentialGroup()
                .addComponent(jLImgPostre, javax.swing.GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE)
                .addContainerGap())
        );

        jBRegistrarPedido.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBRegistrarPedido.setForeground(new java.awt.Color(204, 0, 102));
        jBRegistrarPedido.setText("REGISTRAR PEDIDO");
        jBRegistrarPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBRegistrarPedidoActionPerformed(evt);
            }
        });

        jBCancelarRegPedido.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBCancelarRegPedido.setForeground(new java.awt.Color(204, 0, 102));
        jBCancelarRegPedido.setText("CANCELAR EL REGISTRO ACTUAL");
        jBCancelarRegPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelarRegPedidoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPIngresoPedidoLayout = new javax.swing.GroupLayout(jPIngresoPedido);
        jPIngresoPedido.setLayout(jPIngresoPedidoLayout);
        jPIngresoPedidoLayout.setHorizontalGroup(
            jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                        .addComponent(jPBebida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                                .addGap(56, 56, 56)
                                .addComponent(jBRegistrarPedido)
                                .addGap(34, 34, 34)
                                .addComponent(jBCancelarRegPedido))
                            .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                                .addGap(32, 32, 32)
                                .addComponent(jPPostre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPPlatoFuerte, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPEntrada, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(338, 338, 338))
        );
        jPIngresoPedidoLayout.setVerticalGroup(
            jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                .addComponent(jPEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPPlatoFuerte, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(jPPostre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPIngresoPedidoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jBRegistrarPedido)
                            .addComponent(jBCancelarRegPedido)))
                    .addGroup(jPIngresoPedidoLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPBebida, javax.swing.GroupLayout.PREFERRED_SIZE, 264, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jTPGeneral.addTab("Ingreso de Pedidos", jPIngresoPedido);

        jLCuentas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/platosFuertes.jpg"))); // NOI18N
        jLCuentas.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jPCuentaIndividual.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cuenta individual", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jTACtaIndividual.setColumns(20);
        jTACtaIndividual.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jTACtaIndividual.setForeground(new java.awt.Color(153, 0, 102));
        jTACtaIndividual.setRows(5);
        jScrollPane1.setViewportView(jTACtaIndividual);

        jBPagarCtaIndividual.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBPagarCtaIndividual.setForeground(new java.awt.Color(204, 0, 102));
        jBPagarCtaIndividual.setText("PAGAR ESTA CUENTA");

        javax.swing.GroupLayout jPCuentaIndividualLayout = new javax.swing.GroupLayout(jPCuentaIndividual);
        jPCuentaIndividual.setLayout(jPCuentaIndividualLayout);
        jPCuentaIndividualLayout.setHorizontalGroup(
            jPCuentaIndividualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPCuentaIndividualLayout.createSequentialGroup()
                .addGroup(jPCuentaIndividualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPCuentaIndividualLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPCuentaIndividualLayout.createSequentialGroup()
                        .addGap(93, 93, 93)
                        .addComponent(jBPagarCtaIndividual)))
                .addContainerGap(26, Short.MAX_VALUE))
        );
        jPCuentaIndividualLayout.setVerticalGroup(
            jPCuentaIndividualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPCuentaIndividualLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jBPagarCtaIndividual)
                .addContainerGap())
        );

        jPCuentaPorMesa.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cuenta por mesa", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jTACtaMesa.setColumns(20);
        jTACtaMesa.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jTACtaMesa.setForeground(new java.awt.Color(153, 0, 102));
        jTACtaMesa.setRows(5);
        jScrollPane2.setViewportView(jTACtaMesa);

        jBCtaConsolidada.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBCtaConsolidada.setForeground(new java.awt.Color(204, 0, 102));
        jBCtaConsolidada.setText("VER CUENTA CONSOLIDADA");
        jBCtaConsolidada.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jBCtaConsolidadaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jBCtaConsolidadaMouseExited(evt);
            }
        });

        jBCtaDetallada.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBCtaDetallada.setForeground(new java.awt.Color(204, 0, 102));
        jBCtaDetallada.setText("VER CUENTA DETALLADA");
        jBCtaDetallada.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jBCtaDetalladaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jBCtaDetalladaMouseExited(evt);
            }
        });
        jBCtaDetallada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCtaDetalladaActionPerformed(evt);
            }
        });

        jBPagarCtaMesa.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBPagarCtaMesa.setForeground(new java.awt.Color(204, 0, 102));
        jBPagarCtaMesa.setText("PAGAR CUENTA DE LA MESA");

        javax.swing.GroupLayout jPCuentaPorMesaLayout = new javax.swing.GroupLayout(jPCuentaPorMesa);
        jPCuentaPorMesa.setLayout(jPCuentaPorMesaLayout);
        jPCuentaPorMesaLayout.setHorizontalGroup(
            jPCuentaPorMesaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPCuentaPorMesaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPCuentaPorMesaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPCuentaPorMesaLayout.createSequentialGroup()
                        .addGroup(jPCuentaPorMesaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPCuentaPorMesaLayout.createSequentialGroup()
                                .addComponent(jBCtaConsolidada, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jBCtaDetallada)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPCuentaPorMesaLayout.createSequentialGroup()
                        .addComponent(jBPagarCtaMesa)
                        .addGap(111, 111, 111))))
        );
        jPCuentaPorMesaLayout.setVerticalGroup(
            jPCuentaPorMesaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPCuentaPorMesaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPCuentaPorMesaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBCtaConsolidada)
                    .addComponent(jBCtaDetallada))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBPagarCtaMesa)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPCuentasLayout = new javax.swing.GroupLayout(jPCuentas);
        jPCuentas.setLayout(jPCuentasLayout);
        jPCuentasLayout.setHorizontalGroup(
            jPCuentasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPCuentasLayout.createSequentialGroup()
                .addGroup(jPCuentasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPCuentasLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLCuentas, javax.swing.GroupLayout.PREFERRED_SIZE, 887, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPCuentasLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPCuentaIndividual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPCuentaPorMesa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(62, Short.MAX_VALUE))
        );
        jPCuentasLayout.setVerticalGroup(
            jPCuentasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPCuentasLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPCuentasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPCuentaIndividual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPCuentaPorMesa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLCuentas, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTPGeneral.addTab("Liquidación de Cuentas", jPCuentas);

        jPPedidoActual.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Pedido Actual", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        jScrollPane3.setForeground(new java.awt.Color(153, 0, 102));
        jScrollPane3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jTAComidas.setColumns(20);
        jTAComidas.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jTAComidas.setForeground(new java.awt.Color(153, 0, 102));
        jTAComidas.setRows(5);
        jScrollPane3.setViewportView(jTAComidas);

        jLEntrada4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLEntrada4.setForeground(new java.awt.Color(153, 0, 51));
        jLEntrada4.setText("Comidas:");

        jLEntrada5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLEntrada5.setForeground(new java.awt.Color(153, 0, 51));
        jLEntrada5.setText("Bebidas:");

        jScrollPane4.setForeground(new java.awt.Color(153, 0, 102));
        jScrollPane4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jTABebidas.setColumns(20);
        jTABebidas.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jTABebidas.setForeground(new java.awt.Color(153, 0, 102));
        jTABebidas.setRows(5);
        jScrollPane4.setViewportView(jTABebidas);

        javax.swing.GroupLayout jPPedidoActualLayout = new javax.swing.GroupLayout(jPPedidoActual);
        jPPedidoActual.setLayout(jPPedidoActualLayout);
        jPPedidoActualLayout.setHorizontalGroup(
            jPPedidoActualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPPedidoActualLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPPedidoActualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
                    .addComponent(jLEntrada4, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLEntrada5, javax.swing.GroupLayout.Alignment.LEADING))
                .addContainerGap())
            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)
        );
        jPPedidoActualLayout.setVerticalGroup(
            jPPedidoActualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPedidoActualLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(jLEntrada4)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLEntrada5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPOpciones.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Opciones", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(204, 0, 102))); // NOI18N

        buttonGroup1.add(jRBAgregarEntrada);
        jRBAgregarEntrada.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jRBAgregarEntrada.setForeground(new java.awt.Color(204, 0, 102));
        jRBAgregarEntrada.setText("AGREGAR ENTRADA");

        buttonGroup1.add(jRBAgregarPlatoFuerte);
        jRBAgregarPlatoFuerte.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jRBAgregarPlatoFuerte.setForeground(new java.awt.Color(204, 0, 102));
        jRBAgregarPlatoFuerte.setText("AGREGAR PLATO FUERTE");

        buttonGroup1.add(jRBAgregarPostre);
        jRBAgregarPostre.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jRBAgregarPostre.setForeground(new java.awt.Color(204, 0, 102));
        jRBAgregarPostre.setText("AGREGAR POSTRE");

        buttonGroup1.add(jRBAgregarBebida);
        jRBAgregarBebida.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jRBAgregarBebida.setForeground(new java.awt.Color(204, 0, 102));
        jRBAgregarBebida.setText("AGREGAR BEBIDA");

        javax.swing.GroupLayout jPOpcionesLayout = new javax.swing.GroupLayout(jPOpciones);
        jPOpciones.setLayout(jPOpcionesLayout);
        jPOpcionesLayout.setHorizontalGroup(
            jPOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPOpcionesLayout.createSequentialGroup()
                .addGap(38, 38, 38)
                .addGroup(jPOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jRBAgregarPlatoFuerte, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jRBAgregarEntrada, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jRBAgregarPostre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jRBAgregarBebida, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPOpcionesLayout.setVerticalGroup(
            jPOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPOpcionesLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jRBAgregarEntrada)
                .addGap(18, 18, 18)
                .addComponent(jRBAgregarPlatoFuerte)
                .addGap(18, 18, 18)
                .addComponent(jRBAgregarPostre)
                .addGap(18, 18, 18)
                .addComponent(jRBAgregarBebida)
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jPBotones.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jBContinuar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBContinuar.setForeground(new java.awt.Color(204, 0, 102));
        jBContinuar.setText("CONTINUAR");
        jBContinuar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBContinuarActionPerformed(evt);
            }
        });

        jBCancelar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jBCancelar.setForeground(new java.awt.Color(204, 0, 102));
        jBCancelar.setText("CANCELAR");

        javax.swing.GroupLayout jPBotonesLayout = new javax.swing.GroupLayout(jPBotones);
        jPBotones.setLayout(jPBotonesLayout);
        jPBotonesLayout.setHorizontalGroup(
            jPBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPBotonesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jBContinuar, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
                .addComponent(jBCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18))
        );
        jPBotonesLayout.setVerticalGroup(
            jPBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPBotonesLayout.createSequentialGroup()
                .addGap(38, 38, 38)
                .addGroup(jPBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBContinuar)
                    .addComponent(jBCancelar))
                .addContainerGap(39, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPModificacionesLayout = new javax.swing.GroupLayout(jPModificaciones);
        jPModificaciones.setLayout(jPModificacionesLayout);
        jPModificacionesLayout.setHorizontalGroup(
            jPModificacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPModificacionesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPPedidoActual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPModificacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPModificacionesLayout.createSequentialGroup()
                        .addGap(178, 178, 178)
                        .addComponent(jPOpciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPModificacionesLayout.createSequentialGroup()
                        .addGap(119, 119, 119)
                        .addComponent(jPBotones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(179, Short.MAX_VALUE))
        );
        jPModificacionesLayout.setVerticalGroup(
            jPModificacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPModificacionesLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPModificacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPModificacionesLayout.createSequentialGroup()
                        .addGap(33, 33, 33)
                        .addComponent(jPOpciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPBotones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPPedidoActual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        jTPGeneral.addTab("Modificación de pedidos", jPModificaciones);

        jMBPrincipal.setForeground(new java.awt.Color(102, 0, 102));

        jMOpciones.setText("Opciones");

        jMIRegNuevoProd.setText("Registrar Nuevo Producto");
        jMIRegNuevoProd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIRegNuevoProdActionPerformed(evt);
            }
        });
        jMOpciones.add(jMIRegNuevoProd);

        jMIRetirarProd.setText("Retirar un producto del Menú");
        jMIRetirarProd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIRetirarProdActionPerformed(evt);
            }
        });
        jMOpciones.add(jMIRetirarProd);

        jMIBuscarProd.setText("Buscar Producto");
        jMOpciones.add(jMIBuscarProd);

        jMIModificarPrecioProd.setText("Modificar Precio Producto");
        jMOpciones.add(jMIModificarPrecioProd);

        jMListados.setText("Generar Listado");

        jMIListadoEntradas.setText("Entradas");
        jMIListadoEntradas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIListadoEntradasActionPerformed(evt);
            }
        });
        jMListados.add(jMIListadoEntradas);

        jMIListadoPlatosFuertes.setText("Platos Fuertes");
        jMIListadoPlatosFuertes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIListadoPlatosFuertesActionPerformed(evt);
            }
        });
        jMListados.add(jMIListadoPlatosFuertes);

        jMIListadoPostres.setText("Postres");
        jMIListadoPostres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIListadoPostresActionPerformed(evt);
            }
        });
        jMListados.add(jMIListadoPostres);

        jMIListadoBebidas.setText("Bebidas");
        jMIListadoBebidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIListadoBebidasActionPerformed(evt);
            }
        });
        jMListados.add(jMIListadoBebidas);

        jMOpciones.add(jMListados);

        jMBPrincipal.add(jMOpciones);

        jMAcercaDe.setText("Acerca De");
        jMBPrincipal.add(jMAcercaDe);

        setJMenuBar(jMBPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPOcupacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jTPGeneral, javax.swing.GroupLayout.PREFERRED_SIZE, 974, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(45, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(55, 55, 55)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTPGeneral, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                    .addComponent(jPOcupacion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBCtaDetalladaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jBCtaDetalladaMouseEntered
        // TODO add your handling code here:
        jBCtaDetallada.setBackground(Color.white);
    }//GEN-LAST:event_jBCtaDetalladaMouseEntered

    private void jBCtaDetalladaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jBCtaDetalladaMouseExited
        // TODO add your handling code here:
        jBCtaDetallada.setBackground(null);
    }//GEN-LAST:event_jBCtaDetalladaMouseExited

    private void jBCtaConsolidadaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jBCtaConsolidadaMouseEntered
        // TODO add your handling code here:
        jBCtaConsolidada.setBackground(Color.white);
    }//GEN-LAST:event_jBCtaConsolidadaMouseEntered

    private void jBCtaConsolidadaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jBCtaConsolidadaMouseExited
        // TODO add your handling code here:
        jBCtaConsolidada.setBackground(null);
    }//GEN-LAST:event_jBCtaConsolidadaMouseExited

    private void jMIRetirarProdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIRetirarProdActionPerformed

    }//GEN-LAST:event_jMIRetirarProdActionPerformed

    private void jMIRegNuevoProdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIRegNuevoProdActionPerformed
        RegistroNuevoProducto registroProducto = new RegistroNuevoProducto(miRestaurante);
        registroProducto.setVisible(true);
    }//GEN-LAST:event_jMIRegNuevoProdActionPerformed

    public void cargarConsumoActual() {
        jTABebidas.setText(null);
        jTAComidas.setText(null);
        Cliente c = miRestaurante.getClientes()[mesaPedido][sillaPedido];
        ListIterator<Alimento> iterador = c.getPedido().listIterator();
        while (iterador.hasNext()) {
            Alimento a = iterador.next();
            if (a instanceof Comida) {
                jTAComidas.append(a.getCantidad() + " " + a.getNombre());
                jTAComidas.append(System.getProperty("line.separator"));//saltos de linea
            } else if (a instanceof Bebida) {
                jTABebidas.append(a.getCantidad() + " " + a.getNombre());
                jTABebidas.append(System.getProperty("line.separator"));//saltos de linea
            }
        }

    }

    private void jBRegistrarPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRegistrarPedidoActionPerformed
        miRestaurante.getClientes()[mesaPedido][sillaPedido] = new Cliente();
        Cliente c = miRestaurante.getClientes()[mesaPedido][sillaPedido];
        String entrada = (String) jCBEntrada.getSelectedItem();
        int cantEntrada = (Integer) jSCantEntrada.getValue();
        Alimento entra = miRestaurante.buscarAlimento(entrada);
        c.agregarAlimentoPedido(entra, cantEntrada);
        String platoFuerte = (String) jCBPlatoFuerte.getSelectedItem();
        int cantPlatoF = (Integer) jSCantPlatoFuerte.getValue();
        Alimento platoF = miRestaurante.buscarAlimento(platoFuerte);
        c.agregarAlimentoPedido(platoF, cantPlatoF);
        String postre = (String) jCBPostre.getSelectedItem();
        int cantPostre = (Integer) jSCantPostre.getValue();
        Alimento pos = miRestaurante.buscarAlimento(postre);
        c.agregarAlimentoPedido(pos, cantPostre);
        String bebida = (String) jCBBebida.getSelectedItem();
        int cantBebida = (Integer) jSCantBebida.getValue();
        Alimento bebid = miRestaurante.buscarAlimento(bebida);
        String msj = c.agregarAlimentoPedido(bebid, cantBebida);
        JOptionPane.showMessageDialog(null, msj);
        cambiarColor.setBackground(Color.GRAY);
        bloquearComponentesPedido();
    }//GEN-LAST:event_jBRegistrarPedidoActionPerformed

    private void jBContinuarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBContinuarActionPerformed
        if (jRBAgregarEntrada.isSelected()) {
            IngresoEntrada entrada = new IngresoEntrada(miRestaurante, mesaPedido, sillaPedido);
            entrada.setVisible(true);
        }
        if (jRBAgregarBebida.isSelected()) {
            IngresoBebida bebida = new IngresoBebida(miRestaurante, mesaPedido, sillaPedido);
            bebida.setVisible(true);
        }
        if (jRBAgregarPlatoFuerte.isSelected()) {
            IngresoPlatoFuerte platoFuerte = new IngresoPlatoFuerte(miRestaurante, mesaPedido, sillaPedido, this);
            platoFuerte.setVisible(true);
        }
        if (jRBAgregarPostre.isSelected()) {
            IngresoPostre postre = new IngresoPostre(miRestaurante, mesaPedido, sillaPedido);
            postre.setVisible(true);
        }

    }//GEN-LAST:event_jBContinuarActionPerformed

    private void jMIListadoEntradasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListadoEntradasActionPerformed
        jFC = new JFileChooser("Elija una direccion");
        int opc = jFC.showSaveDialog(null);
        if (opc == JFileChooser.APPROVE_OPTION) {
            try {
                miRestaurante.generarArchivoEntrada(jFC.getSelectedFile());
                JOptionPane.showMessageDialog(null, "Guardado");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else {
            JOptionPane.showMessageDialog(null, "Cancelado");
        }


    }//GEN-LAST:event_jMIListadoEntradasActionPerformed

    private void jMIListadoPlatosFuertesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListadoPlatosFuertesActionPerformed
        jFC = new JFileChooser("Elija una direccion");
        int opc = jFC.showSaveDialog(null);
        if (opc == JFileChooser.APPROVE_OPTION) {
            try {
                miRestaurante.generarArchivoPlatoFuerte(jFC.getSelectedFile());
                JOptionPane.showMessageDialog(null, "Guardado");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else {
            JOptionPane.showMessageDialog(null, "Cancelado");
        }
    }//GEN-LAST:event_jMIListadoPlatosFuertesActionPerformed

    private void jMIListadoPostresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListadoPostresActionPerformed
        jFC = new JFileChooser("Elija una direccion");
        int opc = jFC.showSaveDialog(null);
        if (opc == JFileChooser.APPROVE_OPTION) {
            try {
                miRestaurante.generarArchivoPostre(jFC.getSelectedFile());
                JOptionPane.showMessageDialog(null, "Guardado");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else {
            JOptionPane.showMessageDialog(null, "Cancelado");
        }
    }//GEN-LAST:event_jMIListadoPostresActionPerformed

    private void jMIListadoBebidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListadoBebidasActionPerformed
        jFC = new JFileChooser("Elija una direccion");
        int opc = jFC.showSaveDialog(null);
        if (opc == JFileChooser.APPROVE_OPTION) {
            try {
                miRestaurante.generarArchivoBebida(jFC.getSelectedFile());
                JOptionPane.showMessageDialog(null, "Guardado");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else {
            JOptionPane.showMessageDialog(null, "Cancelado");
        }
    }//GEN-LAST:event_jMIListadoBebidasActionPerformed

    private void jBCancelarRegPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelarRegPedidoActionPerformed
       bloquearComponentesPedido();
    }//GEN-LAST:event_jBCancelarRegPedidoActionPerformed

    private void jBCtaDetalladaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCtaDetalladaActionPerformed
   ArrayList ali=    miRestaurante.anotarPedidoCliente(mesaPedido);
   
           for(int i=0; i<ali.size();i++){
               String m= (String)ali.get(i).toString();
               jTACtaMesa.setText(m);
           }
    }//GEN-LAST:event_jBCtaDetalladaActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jBCancelar;
    private javax.swing.JButton jBCancelarRegPedido;
    private javax.swing.JButton jBContinuar;
    private javax.swing.JButton jBCtaConsolidada;
    private javax.swing.JButton jBCtaDetallada;
    private javax.swing.JButton jBPagarCtaIndividual;
    private javax.swing.JButton jBPagarCtaMesa;
    private javax.swing.JButton jBRegistrarPedido;
    private javax.swing.JComboBox jCBBebida;
    private javax.swing.JComboBox jCBEntrada;
    private javax.swing.JComboBox jCBPlatoFuerte;
    private javax.swing.JComboBox jCBPostre;
    private javax.swing.JLabel jLBebida;
    private javax.swing.JLabel jLCantBebida;
    private javax.swing.JLabel jLCantPlatoFuerte;
    private javax.swing.JLabel jLCantPostre;
    private javax.swing.JLabel jLCantidad;
    private javax.swing.JLabel jLCuentas;
    private javax.swing.JLabel jLEntrada;
    private javax.swing.JLabel jLEntrada4;
    private javax.swing.JLabel jLEntrada5;
    private javax.swing.JLabel jLImgBebida;
    private javax.swing.JLabel jLImgEntrada;
    private javax.swing.JLabel jLImgPlatoFuerte;
    private javax.swing.JLabel jLImgPostre;
    private javax.swing.JLabel jLPlatoFuerte;
    private javax.swing.JLabel jLPostre;
    private javax.swing.JMenu jMAcercaDe;
    private javax.swing.JMenuBar jMBPrincipal;
    private javax.swing.JMenuItem jMIBuscarProd;
    private javax.swing.JMenuItem jMIListadoBebidas;
    private javax.swing.JMenuItem jMIListadoEntradas;
    private javax.swing.JMenuItem jMIListadoPlatosFuertes;
    private javax.swing.JMenuItem jMIListadoPostres;
    private javax.swing.JMenuItem jMIModificarPrecioProd;
    private javax.swing.JMenuItem jMIRegNuevoProd;
    private javax.swing.JMenuItem jMIRetirarProd;
    private javax.swing.JMenu jMListados;
    private javax.swing.JMenu jMOpciones;
    private javax.swing.JPanel jPBebida;
    private javax.swing.JPanel jPBotones;
    private javax.swing.JPanel jPCuentaIndividual;
    private javax.swing.JPanel jPCuentaPorMesa;
    private javax.swing.JPanel jPCuentas;
    private javax.swing.JPanel jPEntrada;
    private javax.swing.JPanel jPIngresoPedido;
    private javax.swing.JPanel jPModificaciones;
    private javax.swing.JPanel jPOcupacion;
    private javax.swing.JPanel jPOpciones;
    private javax.swing.JPanel jPPedidoActual;
    private javax.swing.JPanel jPPlatoFuerte;
    private javax.swing.JPanel jPPostre;
    private javax.swing.JRadioButton jRBAgregarBebida;
    private javax.swing.JRadioButton jRBAgregarEntrada;
    private javax.swing.JRadioButton jRBAgregarPlatoFuerte;
    private javax.swing.JRadioButton jRBAgregarPostre;
    private javax.swing.JSpinner jSCantBebida;
    private javax.swing.JSpinner jSCantEntrada;
    private javax.swing.JSpinner jSCantPlatoFuerte;
    private javax.swing.JSpinner jSCantPostre;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTextArea jTABebidas;
    private javax.swing.JTextArea jTAComidas;
    private javax.swing.JTextArea jTACtaIndividual;
    private javax.swing.JTextArea jTACtaMesa;
    private javax.swing.JTabbedPane jTPGeneral;
    // End of variables declaration//GEN-END:variables

    /**
     * Carga las comidas de tipo entrada en el combo de entrada
     */
    public void cargarComboEntradas() {
        jCBEntrada.removeAllItems();

        ListIterator<Alimento> iterator = miRestaurante.getMenu().listIterator();
        while (iterator.hasNext()) {
            Alimento a = iterator.next();
            if (a instanceof Comida) {
                Comida c = (Comida) a;
                if (c.getTipo().equals(Comida.TIPO_ENTRADA)) {
                    jCBEntrada.addItem(c.getNombre());
                }
            }
        }
    }

    /**
     * Carga Combo de bebida
     */
    void cargarComboBebidas() {
        jCBBebida.removeAllItems();
        ListIterator<Alimento> iterator = miRestaurante.getMenu().listIterator();
        while (iterator.hasNext()) {
            Alimento a = iterator.next();
            if (a instanceof Bebida) {
                Bebida c = (Bebida) a;
                jCBBebida.addItem(c.getNombre());
            }
        }
    }

    /**
     * carga combo de postres
     */
    public void cargarComboPostres() {
        jCBPostre.removeAllItems();
        ListIterator<Alimento> iterator = miRestaurante.getMenu().listIterator();
        while (iterator.hasNext()) {
            Alimento a = iterator.next();
            if (a instanceof Comida) {
                Comida c = (Comida) a;
                if (c.getTipo().equals(Comida.TIPO_POSTRE)) {
                    jCBPostre.addItem(c.getNombre());
                }
            }
        }
    }

    /**
     * carga el combo de platos fuertes
     */
    public void cargarComboPlatosFuertes() {
        jCBPlatoFuerte.removeAllItems();
        ListIterator<Alimento> iterator = miRestaurante.getMenu().listIterator();
        while (iterator.hasNext()) {
            Alimento a = iterator.next();
            if (a instanceof Comida) {
                Comida c = (Comida) a;
                if (c.getTipo().equals(Comida.TIPO_PLATO_FUERTE)) {
                    jCBPlatoFuerte.addItem(c.getNombre());
                }
            }
        }
    }

    private void cargarMesas() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 15; j++) {
                mesas[i][j] = new JButton();
                mesas[i][j].setBounds(130 + i * 35, j * 35 + 30, 28, 28);
                mesas[i][j].setVisible(true);
                mesas[i][j].addActionListener(this);
                jPOcupacion.add(mesas[i][j]);

            }
        }
    }

    public void actionPerformed(ActionEvent evt) {
        int aux = 0;
        for (int i = 0; i < 1 && aux == 0; i++) {
            for (int j = 0; j < 15 && aux == 0; j++) {
                if (evt.getSource() == etiquetas[i][j]) {
                    mesaPedido = j;
                    boolean confirmacion = evaluarMesaVacia(j);
                    if (!confirmacion) {
                       jTPGeneral.setSelectedIndex(1);
                    } else {
                        JOptionPane.showMessageDialog(null, "La mesa esta vacia");
                    }

                }
            }
        }

        //Sillas
        for (int i = 0; i < 4 && aux == 0; i++) {
            for (int j = 0; j < 15 && aux == 0; j++) {
                if (evt.getSource() == mesas[i][j]) {
                    cambiarColor = mesas[i][j];
                    sillaPedido = j;
                    mesaPedido = i;
                    if (mesas[i][j].getBackground() == Color.GRAY) {
                        int opc1 = Integer.parseInt(JOptionPane.showInputDialog(null, "Esta silla tiene un pedido vigente. Seleccione la operación que desea realizar:\n1. Calcular la cuenta\n2. Modificar pedido"));
                        if (opc1 == 1) {
                            jTPGeneral.setSelectedIndex(1);
                            aux = 1;
                            mostrarCuentaTotal();
                            
                        }
                        if (opc1 == 2) {
                            jTPGeneral.setSelectedIndex(2);
                            cargarConsumoActual();
                        }
                    } else {
                        int opc2 = JOptionPane.showConfirmDialog(null, "Desea registrar un pedido para esta silla?");
                        if (opc2 == 0) {
                            // mesas[i][j].setBackground(Color.GRAY);
                            jTPGeneral.setEnabled(true);
                            cargarComboBebidas();
                            cargarComboEntradas();
                            cargarComboPlatosFuertes();
                            cargarComboPostres();
                            desbloquarComponentesPedido();
                            aux = 1;

                        }
                    }
                }
            }
        }
    }

    public void mostrarCuentaTotal() {
        jTACtaMesa.setText("La cuenta de la mesa " + (mesaPedido +1)+ " es: " + miRestaurante.calcularCuentaMesa(mesaPedido));
    }

    private void cargarEtiquetas() {
        for (int j = 0; j < 15; j++) {
            etiquetas[0][j] = new JButton("Mesa " + (j + 1));
            etiquetas[0][j].setForeground(Color.GRAY);
            etiquetas[0][j].setBounds(20, j * 35 + 30, 90, 28);
            etiquetas[0][j].setVisible(true);
            etiquetas[0][j].addActionListener(this);
            jPOcupacion.add(etiquetas[0][j]);

        }
    }

    public boolean evaluarMesaVacia(int pos) {
        for (int i = 0; i < 4; i++) {
            if (mesas[i][pos].getBackground() == Color.GRAY) {
                return false;
            }
        }
        return true;
    }

    /**
     * bloquea la actividad de los componentes mientras el usuario las habilita
     */
    public void bloquearComponentesPedido() {
        jCBBebida.setSelectedIndex(0);
        jCBEntrada.setSelectedIndex(0);
        jCBPlatoFuerte.setSelectedIndex(0);
        jCBPlatoFuerte.setSelectedIndex(0);
        jCBBebida.setEnabled(false);
        jCBEntrada.setEnabled(false);
        jCBPlatoFuerte.setEnabled(false);
        jCBPostre.setEnabled(false);
        jSCantBebida.setEnabled(false);
        jSCantEntrada.setEnabled(false);
        jSCantPlatoFuerte.setEnabled(false);
        jSCantPostre.setEnabled(false);
        jBRegistrarPedido.setEnabled(false);
        jBCancelarRegPedido.setEnabled(false);
    }

    /**
     * desbloquea los componentes
     */
    public void desbloquarComponentesPedido() {
        jCBBebida.setEnabled(true);
        jCBEntrada.setEnabled(true);
        jCBPlatoFuerte.setEnabled(true);
        jCBPostre.setEnabled(true);
        jSCantBebida.setEnabled(true);
        jSCantEntrada.setEnabled(true);
        jSCantPlatoFuerte.setEnabled(true);
        jSCantPostre.setEnabled(true);
        jBRegistrarPedido.setEnabled(true);
        jBCancelarRegPedido.setEnabled(true);
        jCBBebida.setSelectedIndex(0);
        jCBEntrada.setSelectedIndex(0);
        jCBPlatoFuerte.setSelectedIndex(0);
        jCBPostre.setSelectedIndex(0);
    }

}
